<template>
<el-container>
    <el-header class="mianbaoxie">
   <el-breadcrumb
              separator-class="el-icon-arrow-right"
              class="man-el"
            >
              <el-breadcrumb-item :to="{ path: '/thi' }"
                >保险公司管理</el-breadcrumb-item
              >
              <el-breadcrumb-item>添加保险公司</el-breadcrumb-item>
            </el-breadcrumb>
    </el-header>
    <el-main>
        <div class="man">
        
            <div class="man-div">
                <span>*保险公司名称</span>
                <el-input class="man-div-input" v-model="input5.input1"></el-input>
            </div>
            <div class="man-div">
                <span>*保险公司短名称</span>
                <el-input v-model=" input5.input2"></el-input>
            </div>
            <div class="man-div">
                <span>*保险公司公司报案电话</span>
                <el-input v-model="input5.input3"></el-input>
            </div>
             <div class="div-man">
                <span>*是否支持垫付</span>
                <div>
                <el-radio v-model="input5.radio" label=true>是</el-radio>
                <el-radio v-model="input5.radio" label=false>否</el-radio>
                </div>
            </div>
            <div class="man-div">
                <span>*保险公司地址</span>
                <el-input v-model="input5.input4" ></el-input>
            </div>
             <div class="man-div-buttom">
               <el-button class="man-div-buttom1" type="primary" @click="submitForm">保存</el-button>
               <el-button class="man-div-buttom1" @click="resetForm">取消</el-button>
            </div>
            </div>
      
    </el-main>
</el-container>
</template>

<script>

export default {
  data() {
    return {
         input5:{ 
             radio: true,  //是否支持垫付
             input1:'' ,//保险公司名称
             input2:'', //保险公司短名
             input3:'', //保险公司电话
             input4:'',   //保险公司地址
             },
        
    };
  },
  methods: {
    //保存添加保险公司
    submitForm(){
     console.log(this.input5);

        this.$axios({
            url:'/insuranceCompanyManagement/add',
            method:'post',
            data:{
               address: this.input5.input4,
               companyName: this.input5.input1,
               emergencyPhone: this.input5.input3,
               pay: this.input5.radio,
               shortName: this.input5.input2
            } ,
            
         }).then(res=>{
            
           if(res.data.code===0) {
               alert('添加成功');
             this.$router.push('/home/thi1/baoxian')
           }
     
         })
         
         
         
    },
    //取消
    resetForm(){
         this.$router.push('/home/thi1/baoxian')
    }
  },
}
</script>

<style lang="less" scoped>
 .mianbaoxie{
  border-bottom: 1px solid #425877;
 
 }
 .man-div{
    width: 300px;
    line-height: 40px;
 }
 man-div-input{
    border-top: 1px solid rgba(29, 28, 28, 0.781);
 }
 .div-man{
    margin: 30px;
    margin-left: 0px;
 }
 .man-el{
    height: 60px;
    line-height: 60px;
    font-size: 20px;
 }
 .man-div-buttom{
    margin-top: 50px;
    
 }
 .man-div-buttom1{
    width: 150px;
    height: 50px;
    
 }
 .man{
    margin-left: 100px;
 }
</style>